package guyubao.com.GreenLoong.entity;
/*
 * @Date: 2023-12-25 14:32:52
 * @LastEditTime: 2024-02-24 11:52:43
 * @LastEditors: Andwxa
 * Github:https://github.com/Andwxa
 * @Description: 任务实体类
 */

import java.util.ArrayList;

public class Task {
    private String command;// 运行的脚本/命令：tack ...
    private String createdAt;// 创建时间：2023-11-01 T00:34:45.842 Z
    private int id;// 固定id
    private int isDisabled = 0; // 是否失效,0不失效,1失效
    private int isPinned = 1; // 是否顶置,0不,1是
    private int isSystem;//
    private ArrayList<String> labels;//
    private long last_execution_time;// 最后执行时间戳
    private long last_running_time;// 最后运行的时间单位秒
    private String log_path;// 日志位置：6d ylan6_jdpro_main_jx_cxj_draw_133/2023-12-25-11-10-00-360. log
    private String name; // 脚本名称
    private String pid;
    private boolean saved; // 是否保存
    private String schedule; // 脚本运行配置：10 11***
    private int status;
    private int sub_id;
    private String timestamp; /*
                               * Sun Dec 24 2023 15:52:59 GMT+0800(China Standard Time);String
                               * updatedAt=2023-12-25 T03:12:15.371 Z
                               */

    public Task(String command, String createdAt, int id, int isDisabled, int isPinned, int isSystem,
            ArrayList<String> labels,
            long last_execution_time, long last_running_time, String log_path, String name, String pid, boolean saved,
            String schedule, int status, int sub_id, String timestamp) {
        this.command = command;
        this.createdAt = createdAt;
        this.id = id;
        this.isDisabled = isDisabled;
        this.isPinned = isPinned;
        this.isSystem = isSystem;
        this.labels = labels;
        this.last_execution_time = last_execution_time;
        this.last_running_time = last_running_time;
        this.log_path = log_path;
        this.name = name;
        this.pid = pid;
        this.saved = saved;
        this.schedule = schedule;
        this.status = status;
        this.sub_id = sub_id;
        this.timestamp = timestamp;
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getIsDisabled() {
        return isDisabled;
    }

    public void setIsDisabled(int isDisabled) {
        this.isDisabled = isDisabled;
    }

    public int getIsPinned() {
        return isPinned;
    }

    public void setIsPinned(int isPinned) {
        this.isPinned = isPinned;
    }

    public int getIsSystem() {
        return isSystem;
    }

    public void setIsSystem(int isSystem) {
        this.isSystem = isSystem;
    }

    public ArrayList<String> getLabels() {
        return labels;
    }

    public void setLabels(ArrayList<String> labels) {
        this.labels = labels;
    }

    public long getLast_execution_time() {
        return last_execution_time;
    }

    public void setLast_execution_time(long last_execution_time) {
        this.last_execution_time = last_execution_time;
    }

    public long getLast_running_time() {
        return last_running_time;
    }

    public void setLast_running_time(long last_running_time) {
        this.last_running_time = last_running_time;
    }

    public String getLog_path() {
        return log_path;
    }

    public void setLog_path(String log_path) {
        this.log_path = log_path;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public boolean isSaved() {
        return saved;
    }

    public void setSaved(boolean saved) {
        this.saved = saved;
    }

    public String getSchedule() {
        return schedule;
    }

    public void setSchedule(String schedule) {
        this.schedule = schedule;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getSub_id() {
        return sub_id;
    }

    public void setSub_id(int sub_id) {
        this.sub_id = sub_id;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((command == null) ? 0 : command.hashCode());
        result = prime * result + ((createdAt == null) ? 0 : createdAt.hashCode());
        result = prime * result + id;
        result = prime * result + isDisabled;
        result = prime * result + isPinned;
        result = prime * result + isSystem;
        result = prime * result + ((labels == null) ? 0 : labels.hashCode());
        result = prime * result + (int) (last_execution_time ^ (last_execution_time >>> 32));
        result = prime * result + (int) (last_running_time ^ (last_running_time >>> 32));
        result = prime * result + ((log_path == null) ? 0 : log_path.hashCode());
        result = prime * result + ((name == null) ? 0 : name.hashCode());
        result = prime * result + ((pid == null) ? 0 : pid.hashCode());
        result = prime * result + (saved ? 1231 : 1237);
        result = prime * result + ((schedule == null) ? 0 : schedule.hashCode());
        result = prime * result + status;
        result = prime * result + sub_id;
        result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Task other = (Task) obj;
        if (command == null) {
            if (other.command != null)
                return false;
        } else if (!command.equals(other.command))
            return false;
        if (createdAt == null) {
            if (other.createdAt != null)
                return false;
        } else if (!createdAt.equals(other.createdAt))
            return false;
        if (id != other.id)
            return false;
        if (isDisabled != other.isDisabled)
            return false;
        if (isPinned != other.isPinned)
            return false;
        if (isSystem != other.isSystem)
            return false;
        if (labels == null) {
            if (other.labels != null)
                return false;
        } else if (!labels.equals(other.labels))
            return false;
        if (last_execution_time != other.last_execution_time)
            return false;
        if (last_running_time != other.last_running_time)
            return false;
        if (log_path == null) {
            if (other.log_path != null)
                return false;
        } else if (!log_path.equals(other.log_path))
            return false;
        if (name == null) {
            if (other.name != null)
                return false;
        } else if (!name.equals(other.name))
            return false;
        if (pid == null) {
            if (other.pid != null)
                return false;
        } else if (!pid.equals(other.pid))
            return false;
        if (saved != other.saved)
            return false;
        if (schedule == null) {
            if (other.schedule != null)
                return false;
        } else if (!schedule.equals(other.schedule))
            return false;
        if (status != other.status)
            return false;
        if (sub_id != other.sub_id)
            return false;
        if (timestamp == null) {
            if (other.timestamp != null)
                return false;
        } else if (!timestamp.equals(other.timestamp))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "Task [command=" + command + ", createdAt=" + createdAt + ", id=" + id + ", isDisabled=" + isDisabled
                + ", isPinned=" + isPinned + ", isSystem=" + isSystem + ", labels=" + labels + ", last_execution_time="
                + last_execution_time + ", last_running_time=" + last_running_time + ", log_path=" + log_path
                + ", name=" + name + ", pid=" + pid + ", saved=" + saved + ", schedule=" + schedule + ", status="
                + status + ", sub_id=" + sub_id + ", timestamp=" + timestamp + "]";
    }

}